<?php
class UsersControllerEvents extends AppControllerEvents {
    private $_name = 'UsersController';
    public function onAfterLogin($event){
        $name = $event->user['User']['username'];
        $event->Controller->User->afterLogin($name);
        $this->log("user {$name} logged in", $this->_name);
    }
    public function onBeforeLogout($event){
        $name = $event->user['User']['username'];
        $this->log("user {$name} logged out", $this->_name);
    }
    public function onAfterConfig($event){
        $event->Activity->add(array(
            'user' => $event->user,
            'content' => __('user :user updated personal profile(nickname&email)', true)
        ));
    }
}

?>
